package com.imooc.sell.util;

import com.imooc.sell.vo.ResultVo;

/**
 * @Author 小柯
 * @Date 2019/6/29  20:53
 **/
public class ResultVoUtil {

    public static ResultVo success(Object object){
        ResultVo resultVo = new ResultVo();


        resultVo.setCode(200);
        resultVo.setMsg("成功");
        resultVo.setData(object);
        return  resultVo;
    }

    public static ResultVo success(){
        return success(null);
    }

    public static ResultVo error(Integer code, String msg){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(code);
        resultVo.setMsg(msg);
        return resultVo;
    }
}
